package com.yboot.starter.tenant.core.api;

import com.yboot.starter.common.core.security.SecurityUserVO;
import com.yboot.starter.common.core.security.UserContext;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class DefaultTenantIdApi implements TenantIdApi {

     private final UserContext userContext;

    @Override
    public String getTenantId() {
        SecurityUserVO securityUserVO = userContext.getUser().orElse(new SecurityUserVO());
        return securityUserVO.getTenantId();
    }
}